window.onerror = function(errorMessage, scriptURI, lineNumber,columnNumber,errorObj)
{
    // logMsg(errorMessage,1,scriptURI,lineNumber,columnNumber,errorObj);
    return false;
};
function jsonpLogCallback(){}
function logMsg(errorMessage,errorNo,requestUrl,lineNumber,columnNumber,errorObj)
{
	var isUse=0;
    var pageHost=window.location.host;
    var pageUrl=window.location.href;

    if(!errorNo){ errorNo='1'; }
    var jsonStr={"errorMsg":errorMessage,"errorNo":errorNo,"requestUrl":requestUrl,"lineNumber":lineNumber,"columnNumber":columnNumber,"errorObj":errorObj,"pageHost":pageHost,"pageUrl":pageUrl};

	var recordUrl="http://www.cichat.com/htmlErrorResponse.html";
	if(isUse==1 && recordUrl){
		$.ajax({
			type: 'GET',
			url: recordUrl,
			async: true,
			dataType: "jsonp",
			timeout: 4000,
			data:jsonStr,
			jsonpCallback:"jsonpLogCallback",
			success:function(data)
			{
				//console.log(data);
			},
			error:function(data)
			{
				//console.log(data);
			},
			complete:function(data)
			{
				//console.log(data);
			}
		});
	}
}


